<?php
function api($url,$param=[],$method='GET',$header=[]){
    $opts=[
        //return string
        CURLOPT_RETURNTRANSFER=>TRUE,
        //connect time wuxian
        CURLOPT_CONNECTTIMEOUT=>0,
        // execute time 30s
        CURLOPT_TIMEOUT=>30,
        // no echo  header
        CURLOPT_HEADER=>FALSE,
        // avoid ssl verify  peer
        CURLOPT_SSL_VERIFYPEER=>FALSE,
        // avoid ssl hostname
        CURLOPT_SSL_VERIFYHOST=>FALSE,
        // set header info
        CURLOPT_HTTPHEADER=>$header
    ];
    switch (strtoupper($method)) {
        case 'GET':
            $opts[CURLOPT_URL]=$url.'?'.http_build_query($param);
            break;
        case 'POST':
            $opts[CURLOPT_URL]=$url;
            $opts[CURLOPT_POST]=TRUE;
            //post fields
            $opts[CURLOPT_POSTFIELDS]=$param;
            break;
    }
    $ch=curl_init();
    curl_setopt_array($ch, $opts);
    $result=curl_exec($ch);
    curl_close($ch);
   echo $result;
}

$header[]  =  'Authorization:bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwibmFtZSI6Ilx1OGQ4NVx1N2VhN1x1N2JhMVx1NzQwNlx1NTQ1OCIsInR5cGUiOiJzeXN0ZW0iLCJhdWQiOiIiLCJleHAiOjE2MDczNjMwMTMsImlhdCI6MTYwNzMzNDIxMywiaXNzIjoiIiwianRpIjoiZTNhOWI3YzE0ZTMyNDIzNGI4OTQ0YzgwYjk2YTZlNjgiLCJuYmYiOjE2MDczMzQyMTMsInN1YiI6IiJ9.xqWzYgHFRtfExCAtbxrsbBD-6ylqA_2CnWsg0S6GIyQ';
$arr=[];
$url='';
//
foreach ($arr as $key=>$v){
    api($url,$arr[$key],'post',$header);
}

//foreach ($arr as $key=>$value){
//
//}

















































































































































































































